﻿using Ec_System.Bll.Web;
using Ec_System.Models.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ec_System.Facade.Web
{
    public class ItemOrderFacade
    {
        ItemOrderManager itemOrderManager = new ItemOrderManager();

        // <summary>
        /// 根据LoginID查询指定的订单(带分页)
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ItemOrderResponseData GetOrderListWithPageByLoginID(ItemOrderRequestData request)
        {
            return itemOrderManager.GetOrderListWithPageByLoginID(request);
        }

        /// <summary>
        /// 退货
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="orderDetailId"></param>
        /// <param name="vendorNumber"></param>
        /// <param name="reason"></param>
        /// <returns></returns>
        public int ReturnOrder(string orderId, string orderDetailId, string vendorNumber, string reason)
        {
            return itemOrderManager.ReturnOrder(orderId, orderDetailId, vendorNumber, reason);
        }

        // <summary>
        /// 根据OrderID和ProductID获取评价订单信息, 用于评价页面
        /// </summary>
        /// <param name="orderID"></param>
        /// <param name="productID"></param>
        /// <returns></returns>
        public ItemOrderData GetOrderInfoByOrderIDAndProductID(string orderID, string productID)
        {
            return itemOrderManager.GetOrderInfoByOrderIDAndProductID(orderID, productID);
        }
    }
}
